package com.qf.controller;

import com.qf.utils.QiNiuTools;
import com.qf.utils.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class UpLoadController {

    @Autowired
    QiNiuTools qiNiuTools;

    @PostMapping("/upload")
    public ResultMsg upload(MultipartFile file){
        String upload = qiNiuTools.upload(file);
        System.out.println("upload = " + upload);
        return ResultMsg.SUCCESS(upload);
    }
}
